#!/bin/bash

echo "just use git diff --color-words"
echo "or set this alias:"
echo 'git config --global alias.wdiff "diff --color-words"'
echo "then:"
echo "git wdiff file"

exit 2

in1=$1
in2=$2

#used for comparing these type of files: /etc/chromium/default
#ignores comments (lines that start with #)

splitify() {
  cat "$1" | awk -e '/^#/ { next;} // {print}' | cut --output-delimiter "\n" -d ' ' -f1- | sed -e 's/\\n/\n/g'
}

diff -up0 -- <(splitify "$in1") <(splitify "$in2") | grep -ve '^@@ ' | colordiff|less -R

# |grep -ve '^\(+++\|---\) '
# ^ this won't trigger colordiff though

